package com.courier.service.impl;

import com.courier.dao.ChatDao;
import com.courier.pojo.Chat;
import com.courier.service.ChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.List;

/**
 * @author mohan lau
 * @version 1.0
 * @ClassName: ChatServiceImpl
 * @Description: TODO  聊天业务逻辑实现类
 * @Date: 2021-05-12 15:16
 */
@Service
public class ChatServiceImpl implements ChatService {
@Autowired
    ChatDao chatDao;
    @Override
    public List<Chat> findAll() {
        return chatDao.findAll();
    }

    @Override
    public Chat findByid(int id) {
        return chatDao.findByid(id);
    }

    @Override
    public boolean updateStatus(Chat chat) {
        return chatDao.updateStatus(chat)>0?true:false;
    }

    @Override
    public boolean delete(Timestamp startTime, Timestamp stopTime) {
        return chatDao.delete(startTime, stopTime)>0?true:false;
    }

    @Override
    public boolean insert(Chat chat) {
        return chatDao.insert(chat)>0?true:false;
    }
}
